package routers

import (
	"beegobegin/controllers"
	"github.com/astaxie/beego"
)

func init() {
    beego.Router("/", &controllers.MainController{})
    beego.Router("/models", &controllers.DemoController{})
    beego.Router("/models/post", &controllers.DemoController{},"post:Post")
    beego.Router("/models/xml", &controllers.DemoController{},"get:Xml;post:Xml")

    //beego.Router("/demo1/:id", &controllers.Demo1Controller{})
    beego.Router("/demo1/uid_:id(\\w+).html", &controllers.Demo1Controller{}, "get:ReGet")
    beego.Router("/demo1/r", &controllers.Demo1Controller{}, "post:Post")
    beego.Router("/user/ins", &controllers.DBController{}, "get:InsertData")
    beego.Router("/user", &controllers.DBController{}, "get:GetUsers")
    beego.Router("/user/:id", &controllers.DBController{}, "get:GetUser")
    beego.Router("/user/:id/update", &controllers.DBController{}, "get:UpdateUser")
    beego.Router("/user/del", &controllers.DBController{}, "get:Del")
    beego.Router("/img/upload", &controllers.DBController{}, "post:ImgUpload")

}
